import java.util.Random;
import java.util.Scanner;

public class arrDome4 {
    public static void main(String[] args) {
        System.out.println("-----------------------");
        String [] students=new String[3];
        //1.存储全班同学名字
        Scanner scanner=new Scanner(System.in);
        for (int i=0;i<students.length;i++){
            System.out.println("储存第"+(i+1)+"个名次：");
            students[i]=scanner.next();
        }
        //2.打印全班同学每一个人的名字
        for (int i=0;i<students.length;i++ ){
            String name=students[i];
            System.out.println("第"+(i+1)+"个学生名称："+name);
        }
        //3.获取随机点名到的学生姓名，并打印
        Random ra=new Random();
        int index=ra.nextInt(students.length);
        String name=students[index];
        System.out.println(name);
    }
}
